
<div class="bg1" style="height: 650px;padding-top: 30px">
<h1 style="color: red">欢迎登陆nba球迷俱乐部</h1>
<form action="" style="background-color: rgba(191,191,191,0.84);margin: 40px 250px;height: 300px;padding: 50px 40px" id="form2">
  <lable>昵&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;称 ：<input  name="username" id="name" type="text" style="margin-top: 20px"/></lable><br/>
  <lable>密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码 ：<input name="pwd" id="pwd" type="password" style="margin-top: 20px"/></lable><br/>
  <button type="submit" id="login" style="margin-top: 20px;margin-left: 80px;width: 130px"  href="">登录</button><br/>
  其他登录方式<br>
  <img src="/images/logini.png" style="margin-left: 80px;margin-top: 10px">
</form>
<div class="imgd">
  <div style="color: blue;margin-bottom: 15px">打开APP/扫码登录</div>
  <img src="/images/asas.png" style="width: 200px;height: 200px"><br>
  <a href="" style="float: right">去注册</a>
</div>
</div>
<script>
  $('#login').click(function (e) {
    e.preventDefault();
    $.post('/users/login', $('#form2').serialize(), function (flag) {
      switch (flag) {
        case 1:
          alert('登录成功');
          location.href = 'http://localhost:1337/users/souye';
          break;
        case 2:
          alert('帐号或者密码错误');
          break;
      }
    })
  });
</script>
